package com.kobe.algorithm.niue.deletechar;

import java.util.*;

/**
 * @author ：caopengfei
 * @date ：2021/5/9
 */
public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            String str = scanner.nextLine();
            int minCount = Integer.MAX_VALUE;
            String [] minStr = null;
            Set<String> setLog = new HashSet<>();
            for (int i = 0; i < str.length(); i++) {
                String strIndex = str.substring(i,i+1);
                if(setLog.contains(strIndex)){
                    continue;
                }else{
                    setLog.add(strIndex);
                }
                int count = 1;
                for (int j = i+1; j < str.length() ; j++) {
                    if(str.substring(j,j+1).equals(strIndex)){
                        count++;
                    }
                }
                if(count == minCount && minStr !=null ){
                    minStr = Arrays.copyOf(minStr,minStr.length+1);
                    minStr[minStr.length-1] = strIndex;
                }else if(count<minCount){
                    minCount = count;
                    minStr = new String[1];
                    minStr[0] = strIndex;
                }

            }
            for (int i = 0; i < minStr.length; i++) {
                str = str.replace(minStr[i],"");
            }
            System.out.println(str);
        }

    }
}
